home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Michael D. Crawford↵ / Word Services SDK 1.0.5 / Writeswell Jr. Source / WWJrAbout.c < prev   
Text File  |  1993-03-08  |  1KB  |  86 lines

  1. /* WWJrAbout.c
  2.  * Handle about box for Writeswell Jr.
  3.  * Copyright ©1993 Working Software, Inc.  All Rights Reserved.
  4.  * 1 Mar 93 Mike Crawford
  5.  */
  6.  
  7. #include "TBConstants.h"
  8. #include "TBGlobals.h"
  9. #include "WWJrAbout.h"
  10. #include "AboutVersion.h"
  11.  
  12. void DoAboutMe( void )
  13. {
  14.     DialogPtr    dlg;
  15.     short        item;
  16.     short        curFile;
  17.     
  18.     dlg = GetNewDialog( kAboutMeID, (Ptr)NULL, (WindowPtr) -1 );
  19.  
  20.     if ( !dlg )
  21.         return;
  22.     
  23.     curFile = CurResFile();
  24.     UseResFile( gAppFileRefNum );
  25.  
  26.     /* 1.0.2 display the version number from the 'vers' resource -
  27.      * Install a "user item" to draw it in a custom font
  28.      */
  29.  
  30.     InstallAboutVersionProc( dlg, kAVersItem );
  31.  
  32.     do {
  33.         ModalDialog( (ProcPtr)NULL, &item );
  34.     } while ( item != 1 );
  35.     
  36.     DisposDialog( dlg );
  37.     
  38.     UseResFile( curFile );
  39.  
  40.     return;
  41. }
  42.  
  43. #ifdef NEVER
  44. pascal void AboutVersionProc( DialogPtr dlg, short item )
  45. {
  46.     Handle        h;
  47.     short        kind;
  48.     Rect        r;
  49.     GrafPtr        oldPort;
  50.     VersRecHndl    versH;
  51.     
  52.     /* Draw the version number by getting it from the vers
  53.      * resource.  Saves a lot of time when making a new master disk
  54.      */
  55.          
  56.     versH = (VersRecHndl)GetResource( 'vers', rVersID );
  57.  
  58.     if ( !versH ){
  59.         return;
  60.     }
  61.     
  62.     GetPort( &oldPort );
  63.     SetPort( dlg );
  64.     
  65.     GetDItem( dlg, item, &kind, &h, &r );
  66.     
  67.     MoveTo( r.left, r.bottom );
  68.     
  69.     HLock( versH );
  70.     
  71.     PenNormal();
  72.     TextFont( applFont );
  73.     TextSize( 10 );
  74.     TextFace( 0 );
  75.  
  76.     DrawString( (*versH)->shortVersion );
  77.     
  78.     HUnlock( versH );
  79.     ReleaseResource( versH );
  80.     
  81.     SetPort( oldPort );
  82.  
  83.     return;
  84. }
  85. #endif
  86.